package com.huangliusong;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.HashSet;
import java.util.Set;

/**
 * 引导类
 * @author huangliusong
 * @since 2018/10/23
 * {@link SpringBootApplication}
 */

public class SpringApplicationBootstrap {
    public static void main(String[] args) {
        Set<String> source=new HashSet<>();
        System.out.println(ApplicationConfiguration.class.getName());
        source.add(ApplicationConfiguration.class.getName());
        SpringApplication application=new SpringApplication();
        application .setSources(source)
                ;
        //application.setWebApplicationType(WebApplicationType.NONE);
        ConfigurableApplicationContext context=application.run();

        ApplicationConfiguration applicationConfiguration=context.getBean(ApplicationConfiguration.class);
        System.out.println(applicationConfiguration.pp());
    }



    @SpringBootApplication
    public static class ApplicationConfiguration{



        public String pp(){
            System.err.println(this.getClass().getName());
            return "pp";
        }
    }

}
